#include <iostream>
using namespace std;
const int MOD = 1000000007;
int main()
{
    int n = 0, x = 1, y = 2;
    cin >> n;
    for(int i = 2; i <= n; ++i)
    {
        int tmpx = x;
        x = (2 * y + 1) % MOD;
        y = ((2 * y) % MOD + tmpx + 2) % MOD;
    }
    cout << x << " " << y;
    return 0;
}